﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Bzure.Mvc.ResourceAccess
{
    public class ResourceAccessAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "ResourceAccess";
            }
        }
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
              "ResourceAccess_Image",
              "Apps/ResourceAccess/Image/{location}/{id}",
              new { controller = "Resource", action = "Image", location = UrlParameter.Optional, id = UrlParameter.Optional }
          );
            context.MapRoute(
              "ResourceAccess_CSS",
              "Apps/ResourceAccess/CSS/{location}/{id}",
              new { controller = "Resource", action = "CSS", location = UrlParameter.Optional, id = UrlParameter.Optional }
          );
            context.MapRoute(
              "ResourceAccess_Script",
              "Apps/ResourceAccess/Script/{location}/{id}",
              new { controller = "Resource", action = "Script",location=UrlParameter .Optional , id = UrlParameter.Optional }
          );
            context.MapRoute(
                "ResourceAccess_Default",
                "Apps/ResourceAccess/{controller}/{action}/{id}",
                new { controller = "Resource", action = "Index", id = UrlParameter.Optional }
            );
        }
    }
}